﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><?= $course_detail->data['title']?></title>
    <link rel="stylesheet" href="business/style/common.css?v=20170112">
    <script src="business/js/jquery.js"></script>
    <script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="app/js/common/vue.min.js"></script>
    <script src="app/js/common/hprose.js"></script>
    <script src="app/js/common.js"></script>
    <style>
        .author p{font-size: 11pt; font-family: 华文楷体;}
        .author p span{font-size: 11pt; font-family: 华文楷体;color:#666!important;line-height:1.5;}

        .ab_process{ width:100%; overflow:hidden; margin-top:10px; margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid #C8C8C8; }
        .ab_process .ab_process_btn{ padding:0 20px; margin-bottom:20px; }
        .ab_process .ab_process_btn button{ width:100%; height:40px; border:1px solid #20BE35; border-radius:2px; font-size:0.68267rem; color:#FFF; background-color:#20BE35; display:block; }
        .ab_process ul{ overflow:hidden; margin:0 20%; padding:0; background:url(business/images/ab_process_ul_bg.png) repeat-x center top; background-size:200px 18px; }
        .ab_process li{ width:33.3%; overflow:hidden; float:left; list-style:none; text-align:center; }
        .ab_process li div{ width:24px; height:24px; border:3px solid #F8F8F8; background-color:#C8C8C8; line-height:24px; text-align:center; font-size:0.68267rem; margin:auto; border-radius:24px; color:#FFF; }
        .ab_process li p{ width:100%; text-align:center; font-size:0.7rem; color:#999; font-weight:bold; margin-top:5px; }
        .ab_process .cli div{ border:3px solid #F8F8F8; background-color:#20BE35; }
        .ab_process .cli p{ color:#20BE35; }
        .ab_process .ab_tips{ width:100%; text-align:center; margin-top:10px; }
        .ab_process .ab_tips a{ color:#5C94C6; font-size:0.546132rem; }
        /*弹窗*/
        .ab_open{ width:100%; height:100%; display: none; }
        .ab_open_box{ width:100%; height:100%; background:url(business/images/black_70.png); position:absolute; left:0; top:0; }
        .ab_open_in{ width:172px; margin-left:-86px; overflow:hidden; text-align:center; position:absolute; left:50%; top:20%; background-color:#FFF; }
        .ab_open_in img{ width:172px; }
        .ab_open_in p{ width:100%; font-size:80%; margin-top:0; text-align:center; color:#999; }
        .dowmloadFooter{width: 100%;position: relative;bottom: 0px;height:2.133rem;background:#333;overflow: hidden;border-top: 44px solid #333;left:0;}
        .dowmloadFooter>img{display: block;width:43%;float: left;margin-left:0.384rem;margin-top: 0.356rem;}
        .dowmloadFooter>a{float: right;height:1.408rem;width:4.267rem;border-radius: 0.682rem;background: #fff;color: #D0274A;text-align: center;line-height:1.408rem;font-size: 0.64rem;margin-right:0.4267rem;font-weight: bold;margin-top: 0.3413rem;display: block;text-decoration: none;}
        .dowmloadFooter>span{width:0.9387rem;float: right;margin-right:0.512rem;}
        .dowmloadFooter>span>img{display: block;width: 100%;margin-top: 0.5546rem;}
    </style>
</head>

<body>
<div id="container">
    <div class="dowmloadFooter">
        <img src="business/style/user/style/bottomlogo.png" alt="">
        <span><img src="business/style/user/style/bottomclose.png" alt=""></span>
        <a href="http://app.babydr.cn//aibei/download">立即下载</a>
    </div>
    <div class="header">
        <a class="list" href="<?=$course_index_url?>">课程列表</a>
    </div>

    <div class="class_view">
    <div class="about">
        <input type="hidden" id='url' value="<?=$yuyin_url?>"/>
        <div class="box">
            <div>授课时间</div>
            <h2 v-text="startTime"></h2>
        </div>
        <h1 v-text="data.title"></h1>
    </div>

    <!--未关注-->
    <?php if ($user_status == 1):?>
    <div class="ab_process">
        <div class="ab_process_btn"><button type="button" onclick="$('.ab_open').show()" >关注爱贝儿医</button></div>
        <ul>
            <li class="cli"><div>1</div><p>关注爱贝</p></li>
            <li><div>2</div><p>医师认证</p></li>
            <li><div>3</div><p>开始上课</p></li>
        </ul>
    </div>
    <?php elseif ($user_status == 2):?>
    <!--已关注未认证-->
    <div class="ab_process">
        <div class="ab_process_btn"><button type="button" onclick="location.href = '<?=$renzheng_url?>'">认证您的医师身份</button></div>
        <ul>
            <li class="cli"><div>1</div><p>关注爱贝</p></li>
            <li class="cli"><div>2</div><p>医师认证</p></li>
            <li><div>3</div><p>开始上课</p></li>
        </ul>
        <div class="ab_tips"><a href="http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=504503549&idx=1&sn=0f7a557e1a4f50d741697ca736ecac11&scene=1&srcid=0614SbnEaam1CfFTrJcDKYcO#wechat_redirect">查看认证流程</a></div>
    </div>
    <?php endif;?>

    <!--弹窗-->
    <div class="ab_open">
        <div class="ab_open_box" onclick="$('.ab_open').hide()"></div>
        <div class="ab_open_in"><img src="<?=G_SITE_CDN?>/business/images/erweima.jpg" /><p>长按识别二维码关注爱贝儿医</p></div>
    </div>

    <div class="avatar">
        <img v-bind:src="author.icon" />
        <p style="font-size: 14pt; font-family: 华文楷体; font-weight: bold;color:#333;" v-text="author.name">
        </p>
    </div>
    <div class="author" style="padding-bottom: 2rem;">
        <div v-html="data.content"></div>
        <div v-html="classExt.teachDesc"></div>
    </div>

</div>


<div class="class_view_btn_start">
    <input type="button"  value="报名上课"  style="background:#20BE35;">
    <input type="button"  value="取消报名" style="background:#B5B5B5;">
    <input type="button"  value="进入课程" style="background:#5E94C6;">
    <input type="button"  value="课程回顾" style="background:#5E94C6;">
</div>


<div class="class_view_btn_closed"></div>
</div>

<?php require 'app/templates/common/foot.html'; ?>
</body>
</html>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="business/resource/js/jquery-1.11.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="business/resource/js/bootstrap.min.js"></script>
<script src="business/resource/js/hermes.js"></script>
<script src="app/js/common.js"></script>
<script>

function f报名(状态,id){
    var 已报名 ='<?= $re_course_reg ?>';
    var 课程状态 = "<?=$course_detail->data['状态']?>";

    if(已报名 ==0) {

        var 课程人数限制 = "<?=$course_detail->data['课堂人数上限']?>";
        var 课程id = '<?=$课程id?>';
        var data = {'报名id':id,"状态":状态,'课程人数限制':课程人数限制,'课程id':课程id};
        $.post('<?=$ajax_update_isreg_url?>',data,function(data) {
            var data = eval('('+data+')');
            if(data['result']){
                if(data['result'] == '2'){
                    f人数();
                   // window.location.href="<?=$yuyin_url?>";
                    return false;
                }
                if(状态=='取消报名') {
                    common.showMsgBox1('取消报名成功');
                    $("input[type='button']").attr(
                            'value','报名上课'
                    ).css(
                            'background','#20BE35'
                    ).attr(
                            'onclick', "f报名('报名','<?= $user_is_reg->data['id'] ?>')"
                    );

                }else{
                    if(课程状态 ==='开始') {
                        common.showMsgBox1('报名成功!欢迎进入课程');
                        $("input[type='button']").attr(
                            'value','进入课程'
                        ).css(
                            'background','#5E94C6'
                        ).attr(
                            'onclick',"window.location='<?=$课程?>'"
                        );
                       // window.location.href="<?=$yuyin_url?>";
                    } else{
                        common.showMsgBox1("报名成功!<br />直播入口将在开课前10分钟打开");
                        $("input[type='button']").attr(
                                'value','取消报名'
                        ).css(
                                'background','#B5B5B5'
                        ).attr(
                                'onclick', "f报名('取消报名','<?= $user_is_reg->data['id']?>')"
                        );
                    }
                }

            }else {
                common.showMsgBox1('报名失败');
            }
        });

    } else {
        common.showMsgBox1('同一时间内您已报名其他课程');
    }


}
function f人数(){
   // alert("本课程报名人数已达上限，请持续关注爱贝儿医，更多精彩课程会陆续更新，谢谢！");
    common.showMsgBox1("本课程报名人数已达上限,请持续关注爱贝儿医,更多精彩课程会陆续更新,谢谢！");
}




</script>
